#ifndef PRODUCTEDITDIALOG_H
#define PRODUCTEDITDIALOG_H

#include <QDialog>
#include <QSqlDatabase>

namespace Ui {
class ProductEditDialog;
}

class ProductEditDialog : public QDialog
{
    Q_OBJECT

public:
    explicit ProductEditDialog(QWidget *parent = 0, QSqlDatabase db=QSqlDatabase(), int companyid=0, int prodid=0);
    ~ProductEditDialog();

    virtual void accept();

private slots:
    void on_clientCompanyComboBox_currentIndexChanged(int index);
    void on_colorButton_clicked();
    void on_addTaskButton_clicked();
    void on_removeTaskButton_clicked();
    void on_upTaskButton_clicked();
    void on_downTaskButton_clicked();
    void on_addComponentButton_clicked();
    void on_removeComponentButton_clicked();
    void on_upComponentButton_clicked();
    void on_downComponentButton_clicked();

private:
    void initializeClientList();
    void initializeTaskList();

    Ui::ProductEditDialog *ui;
    QSqlDatabase db_;
    int companyid_;
    int prodid_;
    QColor color_;
};

#endif // PRODUCTEDITDIALOG_H
